package com.banmoon.memento;

public class MementoMain {

    public static void main(String[] args) {
        Originator originator = new Originator(5000, 1226, 888);
        System.out.println("即将挑战Boss，先进行存档");
        Caretaker.setMemento(0, originator.createMemento());

        System.out.println("======= 挑战boss中 =======");
        originator.setHp(originator.getHp()/2);
        originator.setAtk((int)(originator.getAtk()*1.5));
        originator.showCurrentStatus();

        System.out.println("======= 挑战boss中，我还能坚持 =======");
        originator.setHp(originator.getHp()/2);
        originator.setAtk(originator.getAtk()/5);
        originator.showCurrentStatus();

        System.out.println("======= 挑战boss中，有点难度，再存个档 =======");
        Caretaker.setMemento(1, originator.createMemento());
        originator.setHp(originator.getHp()/2);
        originator.setDef(originator.getDef()/5);
        originator.showCurrentStatus();

        System.out.println("======= 挑战boss中，不行啦，抓紧读档 =======");
        originator.restoreMemento(Caretaker.getMemento(0));
        originator.showCurrentStatus();
    }
}
